﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;

namespace Quickuse.Logging
{
    /// <summary>
    /// OSPlatformPathExtenstions
    /// </summary>
    internal static class OSPlatformPathExtenstions
    {
        /// <summary>
        /// 获得 当前操作系统目录分隔符的路径
        /// </summary>
        /// <param name="originalString">originalString</param>
        /// <returns></returns>
        public static string GetOSPlatformPath(this string originalString)
        {
            var sp = Path.DirectorySeparatorChar;
            var win = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
            return win ? originalString.Replace('/', sp) : originalString.Replace('\\', sp);
        }
    }
}
